package com.stars.empoly.utils

import android.app.Activity
import android.content.Context
import android.content.Intent
import com.stars.empoly.activity.LoginActivity
import com.stars.empoly.activity.OneLoginActivity
import com.stars.empoly.activity.RegisterActivity
import com.trailer.base.utils.UiSwitch

object MUiSwitch {

    fun single(context: Context, cls: Class<*>) {
        val intent = Intent(context, cls)
        context.startActivity(intent)
        if (context is Activity) {
            context.overridePendingTransition(UiSwitch.enterAnim, UiSwitch.exitAnim)
        }
    }


    fun toLogin(context: Context) {
        single(context, OneLoginActivity::class.java)
    }

    fun toRegister(context: Context) {
        single(context, RegisterActivity::class.java)
    }

    fun toOneLogin(context: Context){
        single(context,OneLoginActivity::class.java)
    }

}
